const videoApi = {
    /**
     * 视频生成
     *
     * @param params
     * @author zero
     */
    generate(params: any): Promise<any> {
        return $request.post({
            url: '/apply/video/generate',
            params
        })
    },

    /**
     * 视频配置
     *
     * @param {string} engine 视频引擎: [luma,zhipu]
     * @returns {Promise<VideoConfigResponse>}
     * @author zero
     */
    config(engine: string): Promise<VideoConfigResponse> {
        return $request.get<VideoConfigResponse>({
            url: '/apply/video/config',
            params: {
                engine
            }
        })
    },

    /**
     * 视频记录
     *
     * @param params
     * @param {number} [params.page_no] - 当前页码
     * @param {number} [params.page_size] - 每页条数
     * @param {number} [params.status] - 视频状态
     * @param {string} params.engine - 视频引擎
     * @returns {Promise<VideoRecordResponse[]>}
     * @author zero
     */
    record(params: {
        page_no?: number;
        page_size?: number;
        status?: number;
        engine: string;
    }): Promise<VideoRecordResponse[]> {
        return $request.get<VideoRecordResponse[]>({
            url: '/apply/video/record',
            params
        })
    },

    /**
     * 视频检测
     *
     * @param {string[]} ids
     * @returns {Promise<VideoRecordResponse[]>}
     * @author zero
     */
    detection(ids: string[]): Promise<VideoRecordResponse[]> {
        return $request.post<VideoRecordResponse[]>({
            url: '/apply/video/detection',
            params: {
                ids
            }
        })
    },

    /**
     * 视频记录删除
     *
     * @param {string} code
     * @returns {Promise<any>}
     * @author zero
     */
    delete(code: string): Promise<any> {
        return $request.post({
            url: '/apply/video/delete',
            params: {
                code
            }
        })
    },

    /**
     * 视频广场分享
     *
     * @param {string} code
     * @returns {Promise<any>}
     * @author zero
     */
    square(code: string): Promise<any> {
        return $request.post({
            url: '/apply/video/square',
            params: {
                code
            }
        })
    },

    /**
     * 视频记录收藏
     *
     * @param {string} code
     * @returns {Promise<any>}
     * @author zero
     */
    collect(code: string): Promise<any> {
        return $request.post({
            url: '/apply/video/collect',
            params: {
                code
            }
        })
    }
}

export default videoApi
